<?php
//update lại tổng cọc, tổng tiền hiện tại cho toàn bộ khách hàng
include_once '../include/common.php';
$core = new core();

$list_customer_order = $core->db->get_results("SELECT * FROM zen_customer_order");
if($list_customer_order){
    foreach($list_customer_order as $customer_order){
        if($customer_order->code_view ==''){
            $random_code = $core->generateRandomString(20);
            $core->db->query("UPDATE zen_customer_order SET code_view='{$random_code}' WHERE customer_order_id= $customer_order->customer_order_id");
        }

    }

}

echo "DONE";
?>